package cn.outsourcing.supermarket.converter.transform;

import java.util.Optional;

/**
 * integer to boolean transform
 *
 * @author gzkemays
 * @since 2021/11/4 1:40
 */
public class IntegerToBooleanTransform {
  /**
   * integer 转 boolean
   *
   * @param value 转换对象
   * @return 数值
   */
  public static Boolean booleanToInteger(Integer value) {
    return Optional.ofNullable(value).orElse(0) == 1;
  }
}
